<script setup lang="ts" name="Father">
import Son from '@/vueTest/c/02_custom-event/Son.vue'
import {ref} from "vue";

function saveToy(value) {
  console.log('abc被调用', value)
  toy.value = value
}
let toy = ref('')
</script>

<template>
<h3>父组件</h3>
  <h3 v-show="toy"> 收到子组件的：{{toy}}</h3>
  <hr>
<!--  定义自定义事件send-toy-->
  <Son @send-toy="saveToy"/>

</template>

<style scoped>

</style>